<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
<html>
<head>
<script src="../../../../resources/js-test.js"></script>
</head>
<body onload="test()">
<p>This test checks that a long press gesture selects word when touch editing is enabled.</p>
<div id="text">Testing</div>
<div id="result">FAIL</div>
<div id="textDiv">Some text</div>
<script>
function test()
{
    if (window.testRunner)
        testRunner.dumpAsText();

    var textDiv = document.getElementById("textDiv");

    var x = textDiv.offsetParent.offsetLeft + textDiv.offsetLeft + 4;
    var y = textDiv.offsetParent.offsetTop + textDiv.offsetTop + textDiv.offsetHeight / 2;

    if (!window.eventSender)
        return;
    if (eventSender.gestureLongPress) {
        eventSender.gestureLongPress(x, y);
        var selectedText = document.getSelection();
        if (selectedText.toString().length > 0)
            document.getElementById("result").innerHTML = "PASS";
    } else {
        debug("gestureLongPress not implemented by this platform");
        return;
    }
}
</script>
</body>
</html>
